package com.getpebble.android.common.model;

import com.getpebble.android.R;
import com.getpebble.android.common.framework.install.app.AppBundle.Platform;
import com.google.common.primitives.UnsignedInteger;
import com.sun.mail.iap.Response;
import com.sun.mail.imap.protocol.ListInfo;
import com.sun.mail.smtp.SMTPMessage;

public enum HardwarePlatform {
    UNKNOWN(0, "unknown"),
    PEBBLE_ONE_EV1(1, "ev1"),
    PEBBLE_ONE_EV2(2, "ev2"),
    PEBBLE_ONE_EV2_3(3, "ev2_3"),
    PEBBLE_ONE_EV2_4(4, "ev2_4"),
    PEBBLE_ONE_POINT_FIVE(5, "v1_5"),
    PEBBLE_TWO_POINT_ZERO(6, "v2_0"),
    PEBBLE_SNOWY_EVT2(7, "snowy_evt2"),
    PEBBLE_SNOWY_DVT(8, "snowy_dvt"),
    PEBBLE_BOBBY_SMILES(10, "snowy_s3"),
    PEBBLE_ONE_BIGBOARD_2(254, "bb2"),
    PEBBLE_ONE_BIGBOARD(255, "bigboard"),
    PEBBLE_SNOWY_BIGBOARD(253, "snowy_bb"),
    PEBBLE_SNOWY_BIGBOARD_2(252, "snowy_bb2"),
    PEBBLE_SPALDING_EVT(9, "spalding_evt"),
    PEBBLE_SPALDING_PVT(11, "spalding"),
    PEBBLE_SPALDING_BIGBOARD(251, "spalding_bb2");
    
    private final int mId;
    private final String mName;

    static /* synthetic */ class AnonymousClass1 {
        static final /* synthetic */ int[] $SwitchMap$com$getpebble$android$common$model$HardwarePlatform = null;

        static {
            $SwitchMap$com$getpebble$android$common$model$HardwarePlatform = new int[HardwarePlatform.values().length];
            try {
                $SwitchMap$com$getpebble$android$common$model$HardwarePlatform[HardwarePlatform.PEBBLE_SPALDING_EVT.ordinal()] = 1;
            } catch (NoSuchFieldError e) {
            }
            try {
                $SwitchMap$com$getpebble$android$common$model$HardwarePlatform[HardwarePlatform.PEBBLE_SPALDING_PVT.ordinal()] = 2;
            } catch (NoSuchFieldError e2) {
            }
            try {
                $SwitchMap$com$getpebble$android$common$model$HardwarePlatform[HardwarePlatform.PEBBLE_SPALDING_BIGBOARD.ordinal()] = 3;
            } catch (NoSuchFieldError e3) {
            }
            try {
                $SwitchMap$com$getpebble$android$common$model$HardwarePlatform[HardwarePlatform.PEBBLE_SNOWY_EVT2.ordinal()] = 4;
            } catch (NoSuchFieldError e4) {
            }
            try {
                $SwitchMap$com$getpebble$android$common$model$HardwarePlatform[HardwarePlatform.PEBBLE_SNOWY_DVT.ordinal()] = 5;
            } catch (NoSuchFieldError e5) {
            }
            try {
                $SwitchMap$com$getpebble$android$common$model$HardwarePlatform[HardwarePlatform.PEBBLE_SNOWY_BIGBOARD.ordinal()] = 6;
            } catch (NoSuchFieldError e6) {
            }
            try {
                $SwitchMap$com$getpebble$android$common$model$HardwarePlatform[HardwarePlatform.PEBBLE_SNOWY_BIGBOARD_2.ordinal()] = 7;
            } catch (NoSuchFieldError e7) {
            }
            try {
                $SwitchMap$com$getpebble$android$common$model$HardwarePlatform[HardwarePlatform.PEBBLE_BOBBY_SMILES.ordinal()] = 8;
            } catch (NoSuchFieldError e8) {
            }
            try {
                $SwitchMap$com$getpebble$android$common$model$HardwarePlatform[HardwarePlatform.UNKNOWN.ordinal()] = 9;
            } catch (NoSuchFieldError e9) {
            }
            try {
                $SwitchMap$com$getpebble$android$common$model$HardwarePlatform[HardwarePlatform.PEBBLE_ONE_EV1.ordinal()] = 10;
            } catch (NoSuchFieldError e10) {
            }
            try {
                $SwitchMap$com$getpebble$android$common$model$HardwarePlatform[HardwarePlatform.PEBBLE_ONE_EV2.ordinal()] = 11;
            } catch (NoSuchFieldError e11) {
            }
            try {
                $SwitchMap$com$getpebble$android$common$model$HardwarePlatform[HardwarePlatform.PEBBLE_ONE_EV2_3.ordinal()] = 12;
            } catch (NoSuchFieldError e12) {
            }
            try {
                $SwitchMap$com$getpebble$android$common$model$HardwarePlatform[HardwarePlatform.PEBBLE_ONE_EV2_4.ordinal()] = 13;
            } catch (NoSuchFieldError e13) {
            }
            try {
                $SwitchMap$com$getpebble$android$common$model$HardwarePlatform[HardwarePlatform.PEBBLE_ONE_POINT_FIVE.ordinal()] = 14;
            } catch (NoSuchFieldError e14) {
            }
            try {
                $SwitchMap$com$getpebble$android$common$model$HardwarePlatform[HardwarePlatform.PEBBLE_TWO_POINT_ZERO.ordinal()] = 15;
            } catch (NoSuchFieldError e15) {
            }
            try {
                $SwitchMap$com$getpebble$android$common$model$HardwarePlatform[HardwarePlatform.PEBBLE_ONE_BIGBOARD_2.ordinal()] = 16;
            } catch (NoSuchFieldError e16) {
            }
            try {
                $SwitchMap$com$getpebble$android$common$model$HardwarePlatform[HardwarePlatform.PEBBLE_ONE_BIGBOARD.ordinal()] = 17;
            } catch (NoSuchFieldError e17) {
            }
        }
    }

    private HardwarePlatform(int id, String name) {
        this.mId = id;
        this.mName = name;
    }

    public String getName() {
        return this.mName;
    }

    public int getId() {
        return this.mId;
    }

    public static HardwarePlatform fromInt(UnsignedInteger i) {
        for (HardwarePlatform r : values()) {
            if (r.getId() == i.intValue()) {
                return r;
            }
        }
        return UNKNOWN;
    }

    public static HardwarePlatform fromString(String s) {
        for (HardwarePlatform r : values()) {
            if (r.getName().equalsIgnoreCase(s)) {
                return r;
            }
        }
        return UNKNOWN;
    }

    public Platform getPlatformCode() {
        switch (AnonymousClass1.$SwitchMap$com$getpebble$android$common$model$HardwarePlatform[ordinal()]) {
            case SMTPMessage.RETURN_FULL /*1*/:
            case SMTPMessage.RETURN_HDRS /*2*/:
            case ListInfo.INDETERMINATE /*3*/:
                return Platform.CHALK;
            case SMTPMessage.NOTIFY_DELAY /*4*/:
            case R.styleable.WalletFragmentStyle_maskedWalletDetailsHeaderTextAppearance /*5*/:
            case R.styleable.WalletFragmentStyle_maskedWalletDetailsBackground /*6*/:
            case R.styleable.WalletFragmentStyle_maskedWalletDetailsButtonTextAppearance /*7*/:
            case Response.NO /*8*/:
                return Platform.BASALT;
            default:
                return Platform.APLITE;
        }
    }
}
